from utils.common import get_ini_data
from utils.common import get_yaml_data
env_flag = int(get_ini_data(r"./conf/env.ini")["env"]["flag"])  # 也是提前配置好的

import logging


def get_env_info(fields):
    env_info_path = ""
    if env_flag == 0:
        env_info_path = r"./conf/shengchan_env.yaml"
    elif env_flag == 1:
        env_info_path = r"./conf/fangzhen_env.yaml"
    elif env_flag == 2:
        env_info_path = r"./conf/yanshou_env.yaml"

    env_info = get_yaml_data(env_info_path)
    field_list = fields.split('.')
    info = env_info
    for field in field_list:
        info = info[field]
    logging.info(info)
    return info


if __name__ == "__main__":
    print(env_flag)
    print(get_env_info("userId"))